﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "GcmpModelInterface.h"
#include "IExternalObject.h"
#include "ElementCreationOptions.h"
#include "NdbDataSchema.h"

namespace gcmp
{
    class IDocument;
    class Vector3d;

    /// \brief IDrawingPoint 点
    class GCMP_MODEL_INTERFACE_EXPORT IDrawingPoint : public IExternalObject
    {
        DEFINE_CAST_DERIVED(IDrawingPoint, IExternalObject);
    public:
        virtual ~IDrawingPoint();

#pragma region static fuction
        /// \brief 创建点
        ///
        /// \param pDocument   源文档
        /// \param modelViewId 创建点的视图Id
        /// \param position 点位置
        /// \param eco  Element创建选项, ElementCreationOptions::Normal表示正常，ElementCreationOptions::Transient表示临时
        /// \return IDrawingPoint* 创建的点对象指针
        static IDrawingPoint* Create(IDocument* pDocument,const Vector3d& position, const ElementId& modelViewId, ElementCreationOptions eco = ElementCreationOptions::Normal);

        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static UniIdentity GetImplementationUid();

        /// \brief 获取点所属视图
        ///
        /// \return 返回点所属视图
        virtual ElementId GetModelViewId() const = 0;

        /// \brief 设置点位置
        ///
        /// \param position 点的世界坐标
        /// \return bool 返回true表示设置成功，否则设置失败
        virtual bool SetPosition(Vector3d position) = 0;

        /// \brief 获取点位置
        ///
        /// \return Vector3d 返回点位置
        virtual Vector3d GetPosition() const = 0;

        /// \brief 获得点关联更新变化Id
        ///
        /// 点位置、样式变化时会Mark该RdId
        /// \return 点关联更新变化Id
        virtual RegenDataId GetPointChangedRdId() const = 0;

        /// \brief 设置是否可以被选择
        /// 
        /// \param isSelectable true-可以被选择；false-不可以被选择
        /// \return true 设置成功，false设置失败
        virtual bool SetIsSelectable(bool isSelectable) = 0;

        /// \brief 获取是否可以被选择
        /// 
        /// \return true-可以被选择；false-不可以被选择
        virtual bool IsSelectable() const = 0;
    };
}